import dva from "dva";
import "./index.css";
// import RouterConfig from "./router";
// import createHistory from "history/createHashHistory"; // 选择路由模式
// import { persistStore, persistReducer } from "redux-persist";
import createLoading from "dva-loading";
// 1. Initialize
const app = dva({
  // initialState: {},
  // history: require("history").createHashHistory(),
  // extraEnhancers: [],
  // onError() {},
});

// 2. Plugins
// app.use({});

// 3. Model
// app.model(require('./models/example').default);
app.model(require("./models/products").default);
// app.model(ProductModel);

// 4. Router
app.router(require("./router").default);
// app.router(RouterConfig);

app.use(createLoading());

// 5. Start
app.start("#root");
